{literal}
<style>
/*
Back to top button 
*/
#back-top {
	  bottom: 5px;
    position: fixed;
    right: 50px;
	 z-index: 9999999;
}
#back-top a {
	
	display: block;
	text-align: center;
	font: 11px/100% Arial, Helvetica, sans-serif;
	text-transform: uppercase;
	text-decoration: none;
	color: #bbb;
	/* background color transition */
	-webkit-transition: 1s;
	-moz-transition: 1s;
	transition: 1s;
}
#back-top a:hover {
	color: #000;
}
/* arrow icon (span tag) */
#back-top span {
	
	height: 75px;
	display: block;
	margin-bottom: 7px;
	background: #ddd  ;
	/* rounded corners */
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
	/* background color transition */
	-webkit-transition: 1s;
	-moz-transition: 1s;
	transition: 1s;
}
#back-top a:hover span {
	background-color: #777;
}
</style>
{/literal}

<!-- go_top.tpl -->

{php}
global $db,$my_base_url,$my_pligg_base;
{/php}
	
	<p id="back-top">
		<a href="#top"><span><img src='{$my_base_url}{$my_pligg_base}/modules/go_top/img/gotop.png'></span>BACK TO TOP</a>
	</p>
<!--/go_top.tpl -->

{literal}
<script type="text/javascript">
$(document).ready(function(){

	// hide #back-top first
	$("#back-top").hide();
	
	// fade in #back-top
	$(function () {
		$(window).scroll(function () {
			if ($(this).scrollTop() > 100) {
				$('#back-top').fadeIn();
			} else {
				$('#back-top').fadeOut();
			}
		});

		// scroll body to 0px on click
		$('#back-top a').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 800);
			return false;
		});
	});

});
</script>
{/literal}